SetHighlight
Specifies a highlighting color which is applied as a background to the contents of the current paragraph.
Syntax
expression.SetHighlight(sColor);
expression
- A variable that represents a ApiParagraph class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
sColor | Required | highlightColor | Available highlight color. |
Returns
Example
This example sets highlight color "lightGray" for the paragraph.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is a paragraph with the text highlighted with light gray color.");
paragraph.SetHighlight("lightGray");